// IPTEntry.h 
//	Data structures for managing the translation from 
//	physical page # -> virtual page #
//
//	The data structures in this file are used in ipt
//


#ifndef IPT_H
#define IPT_H

#include "copyright.h"
#include "utility.h"

// The following class defines an entry in an IPT Table.
//Each entry defines a mapping from one 
// physical page to one virtual page.
// In addition, there are some extra bits for access control (valid and 
// read-only) and some bits for usage information (use and dirty).

class IPTEntry {
  public:
    int virtualPage;  	// The page number in virtual memory.
    int physicalPage;  	// The page number in real memory (relative to the
			//  start of "mainMemory"
    bool valid;         // If this bit is set, the translation is ignored.
			// (In other words, the entry hasn't been initialized.)
    bool readOnly;	// If this bit is set, the user program is not allowed
			// to modify the contents of the page.
    bool use;           // This bit is set by the hardware every time the
			// page is referenced or modified.
    bool dirty;         // This bit is set by the hardware every time the
			// page is modified.
	AddrSpace *iptSpace; //record process ID
};

#endif


